<?php

namespace App\Exceptions;

use App\Http\Model\OutJson;
use Exception;

/**
 * 错误码异常：直接抛出错误码
 *
 * Created on 2021/10/23 10:34
 * @Author <yuxiang.zhu@asiainnovations.net>
 */
class ErrorCodeException extends Exception
{
    /**
     * 转换异常为 HTTP 响应
     *
     * @param  \Illuminate\Http\Request
     * @param string $msg 错误信息
     * @return \Illuminate\Http\Response
     */
    public function render($request, int $code = 1)
    {
        OutJson::outJsonCustom($code);
    }
}